s1 = ""
s2 = ""
s4 = ""
s3 = ""
def brackseq(s, s1):
    if s.count("(") != s.count(")") or s.count("[") != s.count("]") or s.count("<") != s.count(">") or s.count("{") != s.count("}"):
        return "Неверная"
    for i in s:
        if i == "(":
            s1 += i
        if i == ")":
            if len(s1) > 0:
                if s1[(len(s1) - 1)] == "(":
                    s1 = s1[:-1]
    
        if i == "[":
            s1 += i
        if i == "]":
            if len(s1) > 0:
                    if s1[(len(s1) - 1)] == "[":
                        s1 = s1[:-1]
        if i == "{":
            s1 += i
        if i == "}":
            if len(s1) > 0:
                if s1[(len(s1) - 1)] == "{":
                    s1 = s1[:-1]
        if i == "<":
            s1 += i
        if i == ">":
            if len(s1) > 0:
                if s1[(len(s1) - 1)] == "<":
                    s1 = s1[:-1]
                    
    if len(s1) == 0 and len(s2) == 0 and len(s3) == 0 and len(s4) == 0:
        return "Верная"
    else:
        return "Heверная"
print(brackseq(s, s1))